A C++ wrapper for SQLite 3, easy to use.
Follow SQLitePP
Other Useful Business Software
AI-powered service management for IT and enterprise teams
Give your IT, operations, and business teams the ability to deliver exceptional services—without the complexity. Maximize operational efficiency with refreshingly simple, AI-powered Freshservice.
Rate This Project
Login To Rate This Project
User Reviews
-
// a simple example to use SQLitePP void simple_example() { //define a connection SQLitePP::DBConnection conn; // connect to a database int rc = conn.connect("D:\\mytestdb.db"); if (rc != 0) { std::cout << conn.getErrorMessage() << std::endl; return; } // define a command and set a command text SQLitePP::DBCommand cmd(&conn); cmd.setCommandText("create table tbl_test(id integer not null, name text, contact text)"); rc = cmd.execute(); // execute if (rc != 0) { std::cout << conn.getErrorMessage() << std::endl; return; } // insert data cmd.setCommandText("insert into tbl_test(id, name, contact) values(0, 'gavin', 'vxling@gmail.com')"); rc = cmd.execute(); // execute if (rc != 0) { std::cout << conn.getErrorMessage() << std::endl; return; } // execute a query cmd.setCommandText("select * from tbl_test"); rc = cmd.execute(); // execute if (rc != 0) { std::cout << conn.getErrorMessage() << std::endl; return; } // print all result while (cmd.fetchNext()) { std::cout << cmd.field(0) << ", " << cmd.field(1) << std::endl; } }